package com.hlg.xboot.model;

import com.hlg.xboot.enums.ResourceType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;

/**
 * 资源(照片、音频、视频)
 * Created by yangxin on 2017/4/25.
 */
@DynamicUpdate
@DynamicInsert
@Entity
public class Resource extends BaseModel {

    /**
     * 资源名称
     */
    private String name;

    /**
     * 资源访问地址
     */
    private String url;

    /**
     * 图片高度
     */
    private Integer height;

    /**
     * 图片宽度
     */
    private Integer width;

    /**
     * 资源大小
     */
    private Long size;

    /**
     * 备注
     */
    private String remark;

    /**
     * 资源类型
     * @see ResourceType
     */
    private Integer type = ResourceType.IMAGE.getValue();

    /**
     * 文件类型
     */
    private String mimeType;

    /**
     * 音视频时长
     */
    private String duration;

    /**
     * 视频封面
     */
    private String cover;

    public Resource() {
    }

    public Resource(String name,String url) {
        this.name = name;
        this.url = url;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public String getMimeType() {
        return mimeType;
    }

    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }

    public Resource(Long id) {
        this.id = id;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }


    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


}
